#!/bin/bash
echo " *******************************************************"
echo " *                                                     *"
echo " *                        cross                        *"
echo " *                                                     *"
echo " *          Compute cross correlation between          *"
echo " *             2 optical depth pgm maps                *"
echo " *                                                     *"
echo " *   Martin Aube 2002                                  *"
echo " *                                                     *"
echo " *******************************************************"
echo " "
folder=`pwd`
rm -f core
echo " Experiment directory "$folder
if [ -f crosscorrelation.par ] 
   then   echo " Using existing input parameter file: crosscorrelation.par"

   else   epar_cross   
fi 
ls *.pgm
ln -s ~/AODSEM/Bin/crosscorrelation crosscorrelation
echo " Executing crosscorrelation..."
./crosscorrelation
echo " Deleting temporary files in " $folder
rm -f crosscorrelation
if [ -f core ] 
   then   echo "******** An error occured during execution of cross! ********"
   rm -f core
   echo "Hit <CTRL-c> or <CRTL-z> to kill that process"
   read bidon
else
  echo " Normal end of cross." 
fi 



